<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTaskTable extends Migration
{
    /**
     * Run the migrations.
     * 任务
     * @return void
     */
    public function up()
    {
        Schema::create('task', function (Blueprint $table) {
            $table->increments('id');
	        $table->tinyInteger('store_id')->comment('店铺id');
	        $table->tinyInteger('type')->comment('任务类型:1普通任务，2调动任务');

	        $table->tinyInteger('store_station_id')->comment('店铺岗位id')->nullable();
	        $table->tinyInteger('num')->comment('需要人数')->nullable();

	        $table->tinyInteger('to_department_id')->comment('调入部门id')->nullable();
	        $table->tinyInteger('to_store_station_id')->comment('支援岗位id')->nullable();
	        $table->date('start_day')->comment('支援开始日期')->nullable();
	        $table->date('end_day')->comment('支援结束日期')->nullable();
	        $table->time('start_time')->comment('支援开始时间')->nullable();
	        $table->time('end_time')->comment('支援结束时间')->nullable();
	        $table->string('comment')->comment('任务描述')->nullable();
	        $table->integer('company_id')->comment('所属公司id')->nullable();

	        $table->tinyInteger('status')->comment('是否发布：0未发布，1已发布')->default(0);
	        $table->string('out_staff')->comment('调出员工姓名')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('task');
    }
}
